package com.woniuxy.student.controller;

import com.woniuxy.commons.entity.ErrorSheet;
import com.woniuxy.commons.entity.PageBean;
import com.woniuxy.commons.entity.ResponseEntity;
import com.woniuxy.commons.entity.TestPaper;
import com.woniuxy.commons.util.CommonUtil;
import com.woniuxy.student.dao.StudentDao;
import com.woniuxy.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/16 0016-下午 3:12
 */
@RestController
public class StudentController {
    @Autowired
    StudentService studentService;

    /**
     *  测试前后端交互代码
     * @param id
     * @return
     */
    @GetMapping("/errorSheet/{id}")
    public ErrorSheet getErrorSheetById(@PathVariable("id") int id){
        System.out.println(id);
        ErrorSheet errorSheet  = studentService.getErrorSheetById(id);
        System.out.println(errorSheet);
        return errorSheet;

    }
    @GetMapping("/getPapers/{type}/{subject}/{page}")
    public ResponseEntity<PageBean<TestPaper>> getPapers(@PathVariable("type") String type,@PathVariable("subject") String subject,@PathVariable("page") Integer page){
        ResponseEntity responseEntity = new ResponseEntity();
        return responseEntity;


    }

}
